<!DOCTYPE html>
<html>
{% load static %}
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
    <title>慕学在线注册</title>
    <link rel="stylesheet" type="text/css" href="{% static '/css/reset.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static '/css/login.css' %}">
    <script src="{% static '/js/jquery.min.js' %}" type="text/javascript"></script>
    <script src="{% static '/js/util/myUtil.js' %}" type="text/javascript"></script>
    <script>
        $(function(){
            $('img.captcha').on("click",function(){
                $.get("/captcha/refresh/?"+Math.random(),function(result){
                    $("img.captcha").attr("src",result.image_url);
                    $('#id_captcha_0').attr("value",result.key);
                })
            })
        })
    </script>
</head>
<body>

<header>
    <div class="c-box fff-box">
        <div class="wp header-box">
            <p class="fl hd-tips">慕学在线，在线学习平台！</p>
            <ul class="fr hd-bar">
                <li>服务电话：<span>4001008031</span></li>
                <li><a href="{% url 'users:login' %}">[登录]</a></li>
                <li class="active"><a href="{% url 'users:register' %}">[注册]</a></li>
            </ul>
        </div>
    </div>
</header>
<section>
    <div class="c-box bg-box">
        <div class="login-box clearfix">
            <div class="hd-login clearfix">
                <a class="index-logo" href="{% url 'index' %}"></a>
                <h1>用户注册</h1>
                <a class="index-font" href="{% url 'index' %}">回到首页</a>
            </div>
            <div class="fl slide">
                <div class="imgslide">
                    <ul class="imgs">
                        <li><a href=""><img width="483" height="472" src="/static/images/57a801860001c34b12000460.jpg" /></a></li>
                        <li><a href=""><img width="483" height="472" src="/static/images/57a801860001c34b12000460.jpg" /></a></li>
                        <li><a href=""><img width="483" height="472" src="/static/images/57a801860001c34b12000460.jpg" /></a></li>
                    </ul>
                </div>
                <div class="unslider-arrow prev"></div>
                <div class="unslider-arrow next"></div>
            </div>
            <div class="fl form-box">
                <div class="tab">
                    <h2>邮箱注册</h2>
                </div>
<script>
function checkFields(){
{#    return true#}
    var id_email = $("#id_email").val()
    var id_password = $("#id_password").val()
    if($.lixing.checkEmail(id_email)){
        $("#id_email").parents().removeClass("errorput")
    }
    else{
        alert("邮箱输入错误!")
        $("#id_email").parents().addClass("errorput")
        return false
    }
    if($.lixing.checkPassword(id_password)){
        $("#id_password").parents().removeClass("errorput")
    }
    else{
        alert("密码输入错误!")
        $("#id_password").parents().addClass("errorput")
        return false
    }
    return true
}
</script>
                <div class="tab-form">
                    <form action="{% url 'users:register' %}" onsubmit="return checkFields()" id="email_register_form" method="post" autocomplete="off">
                        {% csrf_token %}
                        <div class="form-group marb20 {% if registerForm.errors.email %}errorput{% endif %}">
                            <label>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱</label>
                            <input style="width:194px" type="text" id="id_email" name="email" value="{% if registerForm.email.value %}{{ registerForm.email.value }}{% endif %}" placeholder="请输入您的邮箱地址" />
                        </div>
                        <div class="form-group marb8 {% if registerForm.errors.password %}errorput{% endif %}">
                            <label>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</label>
                            <input style="width:194px" type="password" id="id_password" name="password"  value="" placeholder="请输入8-15位非中文字符密码" />
                        </div>
                        <div class="form-group marb8 captcha1 {% if registerForm.errors.captcha %}errorput{% endif %}">
                            <label>验&nbsp;证&nbsp;码</label>{{ registerForm.captcha }}
                        </div>
                        <div class="error btns" id="jsEmailTips">
                        {{ msg }}
                        {% for key,error in registerForm.errors.items %}
                        {{ error }}
                        {% endfor %}
                        </div>
                        <div class="auto-box marb8"></div>
                        <input class="btn btn-green" id="jsEmailRegBtn" type="submit" value="注册并登录" />
                    </form>
                </div>
                <p class="form-p">已有账号？<a href="{% url 'users:login' %}">[立即登录]</a></p>
            </div>
        </div>
    </div>
</section>

</body>
</html>